<template>
  <el-dialog title="订单处理" width="600px" v-model="dialogFormVisible">
    <el-form :model="form" size="small">
      <el-form-item label="处理状态" :label-width="formLabelWidth">
        <el-radio-group v-model="form.status">
          <el-radio :label="1">已处理</el-radio>
          <el-radio :label="2">未处理</el-radio>
          <el-radio :label="3">无法处理</el-radio>
          <el-radio :label="4">其他</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="处理描述" :label-width="formLabelWidth">
        <el-input
          type="textarea"
          v-model="form.handle_describe"
          autocomplete="off"
        ></el-input>
      </el-form-item>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button size="small" @click="cancelFunc()">取 消</el-button>
        <el-button size="small" type="primary" @click="confirmFunc()"
          >确 定</el-button
        >
      </span>
    </template>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      //是否显示
      dialogFormVisible: false,
      //表单数据
      form: {
        //处理状态
        status: "",
        //处理描述
        handle_describe: "",
      },
      //左边标签宽度
      formLabelWidth: "120px",
    };
  },
  props: {
    visible: Boolean,
  },
  watch: {
    //监听是否显示
    visible(newVal, oldVal) {
      if (newVal != oldVal) {
        this.dialogFormVisible = newVal;
      }
    },
  },
  created() {},
  methods: {
    /**
     * 确认
     */
    confirmFunc() {
      this.$message({
        type: "success",
        message: "操作成功!",
      });
      this.cancelFunc();
    },

    /**
     * 取消
     */
    cancelFunc() {
      this.$emit("close", false);
    },
  },
};
</script>

<style lang="scss">
</style>